package db;

import java.util.ArrayList;

import protocol.domain.GroupEntry;
import protocol.domain.InstantMessage;



/******************************
 * the interface of IChatFacade
 *  encapsulates the operations
 *  of the database of chatservice
 *  
 * @author wangkaidi
 *
 */
public interface IChatFacade 
{
	/**
	 * register a new user
	 * @param name
	 * @param password
	 * @return
	 */
	public boolean register(String name,String password);
	
	public boolean login(String name,String password);
	
	public void addMessage(String from,String to,String content);
	
	public ArrayList<InstantMessage> getMessages(String id);
	
	public void removeMessage(String id);
	
	public void addFriend(String user,String friendid,String group);
	
	public void removeFriend(String user,String friendid,String groupname);
	
	public void removeFriend(String user,String friendid);
	
	public ArrayList<GroupEntry> getFriends(String username);
	
	public void renameGroup(String userid,String oldgroupname,String newgroupname);
	
	public void removeGroup(String id,String groupname);
	
	public void addRequest(String fromid,String to);
	
	public void removeRequest(String id);
	
	public void addResponse(String fromid,String to);
	
	public void removeResponse(String id);
	
	public void addBlock(String fromid,String destid);
	
	public void releaseBlock(String fromid,String destid);	
	
	public ArrayList<String> getRequest(String id);
	
	public ArrayList<String> getResponse(String id);
	
	public void removeRequest(String fromid,String destid);
	
	public void removeResponse(String fromid,String destid);
	
	public void clearDB();
}
